<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('grade/index')}">成绩列表</a></li>
			<li><a href="{:url('grade/add')}">添加成绩</a></li>
			<li class="active"><a>编辑成绩</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('grade/editpost')}">

			<div class="form-group">
				<label for="school_name" class="col-sm-2 control-label"><span class="form-required">*</span>修改学生姓名</label>
				<div class="col-md-6 col-sm-10">
					<select name='student_id' class="form-control">
						<foreach name="student" item="vo">
							<if $grade.student_id == $vo.id>
								<option value="{$vo.id}" selected>{$vo.student_name}</option>
								<else />
								<option value="{$vo.id}">{$vo.student_name}</option>
							</if>
						</foreach>

					</select>
				</div>
			</div>
			<div class="form-group">
				<label for="school_name" class="col-sm-2 control-label"><span class="form-required">*</span>修改科目</label>
				<div class="col-md-6 col-sm-10">
					<select name='subject_id' class="form-control" id="selectDistrict">
						<foreach name="subject" item="vo">
							<if $grade.subject_id == $vo.id>
								<option value="{$vo.id}" selected>{$vo.subject}</option>
								<else />
								<option value="{$vo.id}">{$vo.subject}</option>
							</if>
						</foreach>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label for="street" class="col-sm-2 control-label"><span class="form-required">*</span>修改成绩</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="street" name="grade" value="{$grade.grade}">
				</div>
			</div>


			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<!--隐藏域-->
					<input type="hidden" name="id" value="{$grade.id}" />
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
					<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script>
		$(function () {

			$('#selectSchool').change('click',function () {

				var schoolId=$('#selectSchool').val();

				$.ajax({
					url:"{:url('student/getSchool')}",
					type:"POST",
					data:{school_id:schoolId},
					success:function (res) {
						console.log(res);
						$('#selectRoom').html(res);
					}
				});
			});
		})
	</script>
	<script>
		$(function () {

			$('#selectProvince').change('click',function () {

				var areaId=$('#selectProvince').val();

				$.ajax({
					url:"{:url('student/getProvince')}",
					type:"POST",
					data:{areaId:areaId},
					success:function (res) {
						console.log(res);
						$('#selectCity').html(res);
					}
				});
			});
		})
	</script>
	<script>
		$(function () {

			$('#selectCity').change('click',function () {

				var areaId=$('#selectCity').val();

				$.ajax({
					url:"{:url('student/getCity')}",
					type:"POST",
					data:{areaId:areaId},
					success:function (res) {
						console.log(res);
						$('#selectDistrict').html(res);
					}
				});
			});
		})
	</script>
</body>
</html>